package com.vrms.app.service.impl;

import com.vrms.app.dao.PatientsDao;
import com.vrms.app.entity.Patients;
import com.vrms.app.service.PatientsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PatientsServiceImpl implements PatientsService {
    @Resource
    private PatientsDao patientsDao;

    @Override
    public List<Patients> listPage(int page, int size, String username) {
        return patientsDao.listPage((page-1)*size,size,username);
    }

    @Override
    public int count(String username) {
        return patientsDao.count(username);
    }

    @Override
    public boolean save(Patients patients) {
        return patientsDao.save(patients)>0;
    }

    @Override
    public boolean update(Patients patients) {
        return patientsDao.update(patients)>0;
    }

    @Override
    public boolean remove(int id) {
        return patientsDao.remove(id)>0;
    }

    @Override
    public List<Patients> list() {
        return patientsDao.list();
    }
}
